package com.big.app.controller;


import com.big.app.entity.ShouCan;
import com.big.app.service.intf.ShouCanService;
import com.big.app.vo1.R;

import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@CrossOrigin// 跨域
@Api(value = "用户注册操作",tags = "用户注册操作")
public class ShouCanController {
    @Autowired
    private ShouCanService service;

    @RequestMapping("/api/all2.do")
    @ResponseBody
    public R a1(){
        R all = service.all();
        System.out.println(all);
        return all;
    }

    @PostMapping("/api/scinsert.do")
    @ResponseBody
    public R b(@RequestBody ShouCan shouCan){
        //System.out.println(urls.getLikecount()+""+urls.getTag()+""+urls.getId());
        return service.insert(shouCan);
    }

    @PostMapping("/api/scdelect.do")
    @ResponseBody
    public R c(@RequestBody ShouCan shouCan){
        //System.out.println(urls.getLikecount()+""+urls.getTag()+""+urls.getId());
        return service.delete(shouCan);
    }
}
